{
// 作用：给对象约束属性和方法
// 基础语法：
// interface 接口名{
//     属性名:类型
// }

interface IPerson{
    name:string
    age:number
    gender:string
    sayHi:()=>void
}
const p1:IPerson={
    name:'李华',
    age:18,
    gender:'男',
    sayHi(){
        console.log('我是李华')
    }
}
p1.sayHi()

// 接口继承：IStudent具备IPerson的所有约束继承
interface IStudent extends IPerson{
    gender:string
    }

type Person={
    name:'张三',
    age:18,
    gender:'女',
   sayHi:()=>void
}
type Student={
    gender:string
}&Person

const s1:IStudent={
    name:'张三',
    age:18,
    gender:'女',
    sayHi(){
        console.log('我是张三')
    }
}
s1.sayHi()
// type ItemType=string|number
// type ArrType=string[]

// interface IStudent{

// }

}